#include <REGX52.H>
#include "LCD1602.h"
#include "Delay.h"
#include "IR.h"


void main()
{
	unsigned char Address=0;
	unsigned char Command=0;
	char x=0;
	LCD_Init();
	IR_INit();
	LCD_ShowString(1,1,"ADDR  COM  NUM");
	LCD_ShowString(2,1,"00    00   000");
	while(1)
	{
		if(IR_GetDataFlag()||IR_GetRepeatFlag())
		{
			Address=IR_GetAddress();
			Command=IR_GetCommand();
			LCD_ShowHexNum(2,1,Address,2);
			LCD_ShowHexNum(2,7,Command,2);
			if(Command==IR_VOL_MINUS)
			{
				x--;
			}
			if(Command==IR_VOL_ADD)
			{
				x++;
			}
			LCD_ShowSignedNum(2,11,x,3);
		}
	}
}
